package com.njupt.yanglonglong.report.demo.config;

import com.njupt.yanglonglong.report.demo.server.SocketServer;
import com.njupt.yanglonglong.report.demo.service.DeviceAppliedService;
import com.njupt.yanglonglong.report.demo.service.impl.DeviceAppliedServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

/**
 * @className: WebSocketConfig
 * @Description: 开启websocket的支持
 * @author: lpl
 * @date: 2021/5/13 17:31
 */
@Configuration
public class WebSocketConfig {
    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }

    @Autowired
    DeviceAppliedService deviceAppliedService;

    @Autowired
    public void setDeviceAppliedService() {
        SocketServer.deviceAppliedService = deviceAppliedService;
    }
}
